#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 110, M = 25010;
int f[M];
int a[N];
int n;
int t;
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n;
        for (int i = 1; i <= n; i++) cin >> a[i];
        memset(f, 0, sizeof f);
        f[0] = 1;
        sort(a + 1, a + n + 1);
        int res = 0;
        for (int i = 1; i <= n; i++)
        {
            if (!f[a[i]]) res++;
            for (int j = a[i]; j <= a[n]; j++) f[j] = f[j] + f[j - a[i]];
        }
        cout << res << endl;
    }
    return 0;
}